import { BaseEntity } from '../../base/entity/base';
import { Column, Entity, Index } from 'typeorm';

/**
 * 代理信息
 */
@Entity('agent_user_info')
export class AgentUserInfo extends BaseEntity {
  // 申请人用户id
  @Column({
    comment: '申请人用户id',
    nullable: true,
  })
  userId: number;

  //    只有四个字段，名字，手机号，邮箱，备注
  @Column({
    comment: '用户名',
    length: 50,
    nullable: true,
  })
  username: string;
  @Column({
    comment: '手机号',
    length: 11,
    nullable: true,
  })
  phone: string;
  @Column({
    comment: '邮箱',
    length: 50,
    nullable: true,
  })
  email: string;
  @Column({
    comment: '备注',
    length: 255,
    nullable: true,
  })
  remark: string;

  // 状态，禁用0 启用1
  @Column({
    comment: '状态',
    nullable: true,
    default: 0,
  })
  status: number;

  // 身份证图片
  @Column({
    comment: '身份证正面图片',
    length: 255,
    nullable: true,
  })
  idCardFrontImg: string;

  // 身份证反面图片
  @Column({
    comment: '身份证反面图片',
    length: 255,
    nullable: true,
  })
  idCardBackImg: string;

  // 营业执照
  @Column({
    comment: '营业执照图片',
    length: 255,
    nullable: true,
  })
  businessLicenseImg: string;

  // 身份证号码
  @Column({
    comment: '身份证号码',
    length: 18,
    nullable: true,
  })
  idCardNo: string;

  // 加盟形式，1是个人，2是企业
  @Column({
    comment: '加盟形式',
    nullable: true,
    default: 1,
  })
  joinType: number;

  // 审核状态, 0待审核，1审核通过，2审核未通过
  @Column({
    comment: '审核状态',
    nullable: true,
    default: 0,
  })
  auditStatus: number;

  // 拒接原因
  @Column({
    comment: '拒接原因',
    length: 255,
    nullable: true,
  })
  rejectReason: string;

  // 分成比例
  @Column({
    comment: '分成比例',
    nullable: true,
    default: 0,
  })
  splitRatio: number;
}
